#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
using namespace std;
class Solution {
public:
    void rotate(vector<int>& nums, int k)
    {
        int nowsize = nums.size();
        k %= nums.size();
        for (int i = 0;i < nowsize - k;++i)
        {
            nums.push_back(nums[i]);
        }
        for (int i = 0;i < nowsize;++i)
        {
            nums[i] = nums[i + nowsize - k];
        }
        nums.resize(nowsize);

    }
};